package com.caesar.exer3;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author caesar
 * @date 2025/7/21
 * @Description:
 * @apiNote
 */
public class DateFormatter {
    private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    //为了线程安全，使用synchronized关键字
    public synchronized String format(Date date){
        return sdf.format(date);
    }
}
